package com.ruoyi.http.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.data.MD5;
import com.ruoyi.http.domain.WeChat01700T;
import com.ruoyi.http.domain.WeChat01800T;
import com.ruoyi.http.service.IWeChatTService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/http/weChat01800")
public class WeChat01800 extends BaseController {

    @Autowired
    private IWeChatTService weChatTService;

    @PostMapping("/weChat")
    public AjaxResult http(WeChat01800T weChat01800T) {
        WeChat01800T weChat = new WeChat01800T();
        weChat01800T.setOrderid(DateUtils.dateTimeNow()+weChat01800T.getHouseid());
        weChat01800T.setPaperscode(MD5.md5(weChat01800T.getPaperscode()));
        weChatTService.insertOrderInfo(weChat01800T);
        weChat = weChatTService.getOrderInfo(weChat01800T);
        return AjaxResult.success(weChat);
    }
}